﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ValidateControl.aspx.cs" Inherits="Demo_ValidateControl" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function customvalidator(source, arguments) {
            source.innerHTML = '<b>Bibi</b>';
            arguments.IsValid = false;
            alert(arguments.value);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ValidationSummary runat="server" ID="va" Font-Bold="False" ShowMessageBox="True" ShowSummary="True" DisplayMode="SingleParagraph" />
        <asp:TextBox ID="passwordText" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="passwordText"></asp:RequiredFieldValidator>
        <asp:RangeValidator runat="server" ErrorMessage="RangeValidator" Type="String" ControlToValidate="passwordText" MinimumValue="1" MaximumValue="45"></asp:RangeValidator>
        <asp:CustomValidator ID="testcustom" runat="server" ErrorMessage="CustomValidator" ClientValidationFunction="customvalidator"></asp:CustomValidator>
        <asp:Button runat="server" Text="Button" />
    </div>
    </form>
</body>
</html>
